package middleware

import (
	"duoke/utils/response"
	"duoke/utils/upgrade"
	"github.com/gin-gonic/gin"
)

func Authorize() gin.HandlerFunc {
	return func(c *gin.Context) {
		//软件授权检查
		if !upgrade.IsAuthorize {
			response.Error(c, "未授权，客服微信：duoyingkf", gin.H{})
			c.Abort()
			return
		}
		c.Next()
	}
}
